package com.yyj.controller;

import com.yyj.dto.CyRoomDto;
import com.yyj.entity.AppSubwayData;
import com.yyj.entity.CyRoom;
import com.yyj.entity.CyUser;
import com.yyj.result.Result;
import com.yyj.result.Results;
import com.yyj.util.BeanUtils;
import com.yyj.util.MapUtils;
import com.yyj.util.TreeUtil;
import com.yyj.vo.Tree;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

@RestController
public class TestController {

//    @Operation(summary = "获取地铁列表")
//    @GetMapping("/getSubways")
//    public Result<Tree> getSubways(@RequestParam(name = "city") String city) {
//        List<AppSubwayData> appSubwayData = MapUtils.subwayParser(city);
//        return Results.success(TreeUtil.createTree(appSubwayData));
//    }
//
    @Operation(summary = "获取地铁列表")
    @GetMapping("/getSub")
    public Result<Tree> getSub(@RequestParam(name = "city") String city) {
       Tree tree = MapUtils.subwayParser(city);
        return Results.success(tree);
   }
}
